home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1958 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.4 KB  |  43 lines

  1. Path: winternet.com!not-for-mail
  2. From: jdege@winternet.com (Jeff Dege)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Newbie question ??
  5. Date: 14 Jan 1996 16:51:09 GMT
  6. Organization: StarNet Communications, Inc
  7. Message-ID: <4dbc9t$q0e@blackice.winternet.com>
  8. References: <4davoi$1vg@peach.america.net>
  9. NNTP-Posting-Host: subzero.winternet.com
  10. X-Newsreader: TIN [UNIX 1.3 950726BETA PL0]
  11.  
  12. On Sun, 14 Jan 1996 13:22:51 GMT, dread (dread@america.net) wrote:
  13. : I get the following error when I try to rebuild a very simple project
  14. : LIBC.lib(wincrt0.obj) : error LNK2001: unresolved external symbol
  15. : "_WinMain@16"
  16. : here is the code
  17. : #include <iostream.h>
  18. : main(){
  19. : cout << "This is a test";
  20. : }
  21. : Using VC++ 2 and win95.  Appreciate any help
  22.  
  23.    You're problem is obvious.  You're using Windows.  It is not possible
  24. to write a program for the Windows environment in standard C.  Most
  25. notably, programs written for Windows don't start with main(), they
  26. start with WinMain(), which takes a whole different set of arguments.
  27. That isn't the only problem, though, because Windows programs don't
  28. have stdin/cin and stdout/cout, either.  Windows doesn't have a command-line
  29. shell, so you can't write programs that work in one.
  30.  
  31.    You really have two choices.  Move to an OS that does have a command-line
  32. shell, (OS/2, Win/NT, Unix, etc.), or compile your program as an MsDOS
  33. program.
  34.  
  35. -- 
  36. When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
  37.  
  38.